boolean to string php

128

boolean to string php -

echo json_encode(true);  // string "true"

echo json_encode(false); // string "false"

// null !== false
echo json_encode(null);  // string "null"

php boolean to string -

$converted_res = $res ? 'true' : 'false';

php convert to boolean -

// (PHP 5 >= 5.5.0, PHP 7)
// boolval — Get the boolean value of a variable
boolval ( mixed $var ) : bool
// Returns the boolean value of var.

Comments

Submit
0 Comments